Skip to content

fix(update): allow stable updates from older previews - #871

Closed
luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/update-latest-from-preview
Closed

fix(update): allow stable updates from older previews#871
luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/update-latest-from-preview

Conversation

@luvs01

@luvs01 luvs01 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Compare an installed preview by its major.minor.patch core when the selected update channel is latest.
  • Keep the latest-channel target strict: a preview registry target is still never accepted as a stable update.
  • Cover both the comparator and the GUI/API update-check result that controls one-click availability.

Problem

An older preview install such as 2.8.2-preview.20260731 cannot be parsed by the stable-only current-version branch. With npm latest at 2.9.1, isNewer() therefore returns false, and the dashboard incorrectly reports already_latest and disables one-click update.

Behavior

  • latest=2.9.1, current=2.8.2-preview.20260731: update available.
  • latest=2.9.1, current=2.9.1-preview.20260731: no update, preserving the existing core-version comparison policy.
  • A preview value in the latest target remains rejected.

Verification

  • bun test tests/update-notify.test.ts tests/update-job.test.ts: 60 passed, 0 failed, 152 assertions.
  • bun run typecheck: passed.
  • bun run privacy:scan: passed.
  • git diff --check upstream/dev...HEAD: passed.

No documentation change is included because this restores the documented existing update-channel behavior rather than adding a new user-facing option.

Summary by CodeRabbit

  • Bug Fixes

    • Improved update checks for preview versions, allowing older previews to detect newer stable releases.
    • Prevented update notifications when a preview already matches the stable release’s base version.
  • Tests

    • Added coverage for preview-to-stable update detection and matching-version behavior.

@github-actions github-actions Bot added the bug Something isn't working label Aug 2, 2026
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c8b955e5-7a81-49f3-8428-1e873e5d4294

📥 Commits

Reviewing files that changed from the base of the PR and between 6edec46 and bc0a569.

📒 Files selected for processing (3)
  • src/update/notify.ts
  • tests/update-job.test.ts
  • tests/update-notify.test.ts

📝 Walkthrough

Walkthrough

Changes

Preview update comparison

Layer / File(s) Summary
Preview base-version comparison and test coverage
src/update/notify.ts, tests/update-job.test.ts, tests/update-notify.test.ts
isNewer compares stable releases with preview versions by major, minor, and patch components. Tests cover updates from older previews and suppression for previews with the same stable base.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: lidge-jun, ingwannu, wibias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes allowing stable updates from older preview versions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc0a569c17

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/update/notify.ts
if (channel === "latest") {
const l = parseStable(latest);
const c = parseStable(current);
const c = parseStable(current) ?? parsePreview(current)?.slice(0, 3);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse multi-component preview identifiers

When the installed build has a supported multi-component prerelease such as 2.8.2-preview.20260731.2, parsePreview() rejects it because its regex permits exactly one numeric component after preview. The release tooling accepts this form, and tests/release-notes.test.ts explicitly exercises same-day suffixes such as .2 and .10; consequently this branch still returns false and the GUI/API reports already_latest even when stable 2.9.1 is available. Parse the core independently of the complete prerelease identifier, or allow all supported numeric components, and cover this form in the update tests.

Useful? React with 👍 / 👎.

lidge-jun added a commit that referenced this pull request Aug 2, 2026
…nnel

Takeover of PR #871's fix. An installed preview such as
2.8.2-preview.20260731 made parseStable(current) return null on the
latest channel, so isNewer() returned false and the GUI reported
already_latest with one-click update disabled. The current side now
falls back to the preview's major.minor.patch core; the target side
stays strict (a preview registry target is never accepted on latest).
Same-base stays not-newer, mirroring the preview channel's O3 rule —
semver §9 tension and the respin-format known limitation are recorded
in devlog/_plan/260802_wt1_update_path_star_prompt/011.
@lidge-jun

Copy link
Copy Markdown
Owner

Superseded by #892, which lands this fix natively (installed previews now compare by their major.minor.patch core on the latest channel; the registry-target side stays strict). The comparator change, the GUI/API availability path, and the semver §9 / respin-format limitations are all covered with regression tests and an independent review. Thank you — the report and the initial patch drove the fix.

@lidge-jun lidge-jun closed this Aug 2, 2026
olddonkey pushed a commit to olddonkey/opencodex that referenced this pull request Aug 2, 2026
Campaign preparation (docs-only): five units under devlog/_plan/260802_wtN_*
with 000 research + 010 implementation roadmaps, claim ledgers verified by a
lunasearch fan-out (Anthropic 1M windows, Copilot mixed-wire, DeepSeek
service_tier, WHATWG extension origins, POSIX rename-over-symlink).

wt1 update-path: PR lidge-jun#871, issue lidge-jun#879 (star-prompt deferral leakage), lidge-jun#557 optional
wt2 zero-leak: PRs lidge-jun#840 lidge-jun#841 lidge-jun#843 lidge-jun#844 lidge-jun#845 lidge-jun#847 (tracker lidge-jun#820)
wt3 provider-wire: PRs lidge-jun#746 lidge-jun#860 lidge-jun#839/lidge-jun#854, issue lidge-jun#875 triage, lidge-jun#616/lidge-jun#837 optional
wt4 server-config: PRs lidge-jun#850 (CORS origin confusion), lidge-jun#869 (symlink destruction)
wt5 windows-service: PRs lidge-jun#868, lidge-jun#861 (issue lidge-jun#848)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants